Java-JFrame visual development and java-jframe Visualization
General steps for Java-JFrame Visual Development
JFrame can be used to create a form similar to the QQ login function.
An example of super simple java getting the coordinates of the mouse and clicking the coordinates (the coordinates of the mouse on the Jframe), click the jframe
1. Place a JLabel label at the top of the window. The text in the label is "show the coordinates of right-click" by default"
2. Add a mouse event to the Jframe
Label:Create a form in Java, import the JFrame class in Java, and then an error occurs:Access restriction:the type QName isn't accessible due to restriction on required library D:\myeclipse professer2014The solution can be as follows:project->properties-> Select Java Build path-> Select libraries, The following interfa
without knowing what it is. However, after the object is created, the object automatically obtains these initial values. */setlocation (x, y);SetSize (H,W);Setresizable (FALSE);SetVisible (TRUE);Setdefaultcloseoperation (Exit_on_close);}}Publicclass jframedemo2{public static void Main (String args[]) {Instantiate class object, prompt to set parametersMyFrame f = new MyFrame (300,300,300,200);}}The above example can also be used without a constructor, as in the instance, the
Java-JFrame-swing nested browser steps,
Java-JFrame-swing nested browser steps
1. functions to be implemented using swing nested browsers:
By embedding a browser in a form using java swing, you can display the content of another project in this browser. You only need to go b
I'm going to write a tutorial on a series of Java graphical interfaces. Each program tries to write only the most streamlined code needed to keep it running, so everyone can understand it.Using the Java graphical interface requires only jdk,eclipse. If the layout abstraction is not powerful enough, it is recommended to install Jigloo First and then copy the
This article describes the Java JFrame output HelloWorld method. Share to everyone for your reference. Specifically as follows:
The basic idea of Java GUI program is based on JFrame, it is the object of window on screen, can maximize, minimize, close. Swing is a development toolkit for developing the
The basic idea of Java GUI program is based on JFrame, which is the object of window on screen, it can be maximized, minimized and closed. Swing is a development kit for developing the Java application user interface. Based on the Abstract Window Toolkit (AWT), you can use any pluggable styling for cross-platform applications. Swing developers can use Swing's ric
);This is not a good solution because the components set on the content pane are not visible,Typically set to this: JFrame frame=New JFrame ("Test"); JPanel p=new JPanel (); Frame.getcontentpane (). SetBackground (color.red); P.setopaque (false); // Set Transparent Frame.add (p); // Add some Components to P ... Frame.setsize (a); Frame.setvisible (t
);p 2.add (B1);p 2.add (B2);p 2.add (B3);// Put P1 on the CENTER position of the BorderLayout in P, P2 is the south position p.add (P1,borderlayout.center);p. Add (P2,borderlayout.south);// P1 uses the gridlayout2x2 layout, P2 uses 1x3, just put all the components P1.setlayout (new GridLayout (2,2));p 2.setLayout (new GridLayout (1,3)); F.getcontentpane (). Add (P);//Window size is 320x100, do not allow the user to resize themselves, visible, the default is not visible f.setsize (320,100); f.set
#开始It's been a while since I've been applying for a blog, but I haven't had time to write blog posts (or couch potato).Recently learning JFrame do Windows encountered a lot of problems in order to solve the problem also murdered a lot of brain cells in order to make more friends do not die a lot of brain cells I put in the study of the problems encountered in the writing came to be my own memoMeng new big guy do not spray the learning process referred
Just touch the Java text box drawing knowledge point, and then can follow the teacher's reminders to do some simple game, to jframe deepen, the following on the greedy snake give some source code, in fact, the implementation of the code is not much, just a little processing can be understood, the following
The Java JFrame can implement a local instantiation window, by adding various controls to the jframe to achieve a variety of corresponding functions.
First, create a window instance
JFrame myframe = new JFrame ();
Ii. setting the various properties of
JFrame The basic idea of –java GUI program is based on JFrame, which is the object of window on screen, which can be maximized, minimized and closed. JPanel –java Graphical user interface (GUI) Toolkit The Panel container class in swing, included in the Javax.swing package, can be nested, and functionality is a lightwe
Java Desktop program GUI programming has been criticized. it seems that people always think that Java cannot develop friendly interfaces at all. the degree of garbage seems to remain in the early stage of the graphic operating system. it seems that all this is due to people's misunderstanding of its "layout manager.
I am not very qualified to comment on this too much, but I would like to introduce a
Figure 1.3
Enter the path and click Finish
Figure 1.4
Start creating: Figure 1.5
Create complete, note changes to the Left Item tab:
Figure 1.6
A project has been created and this is the process of creating a project in NetBeans. When you create another project, select another item in Figure 1.3.
2. Create a new JFrame
In the right-click Source code package, follow the diagram action:
Figure 2.1
After yo
Set JFrame background picture from two ways:
1.Jpanel class Paintcomponent (Graphics g) Redraw background picture
2. Use Layeredpane to add depth to swing controls Allow the build to overlap at the required time
from low to High level is: Default,palette,modal,popup,drag
Run the show: Upload later
API query:Jpanel:http://docs.oracle.com/javase/7/docs/api/javax/swing/jpanel.htmlGraphics:http://docs.oracle.com/javase/7/docs/api/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.